/**
 * Implementacion de la clase ControlNode.
 */

#include <stdlib.h>
#include <string>
#include "controlNode.hpp"

ControlNode::ControlNode() {

}

ControlNode::~ControlNode() {

}

std::string ControlNode::getNodeId()
{
	return this->nodeId;
}
void ControlNode::setNodeId(std::string id)
{
	this->nodeId.clear();
	this->nodeId = id;
	this->status[0] = 1;
}
float ControlNode::getPositionX()
{
	return this->positionX;
}
float ControlNode::getPositionY()
{
	return this->positionY;
}
void ControlNode::setPositionX(float value)
{
	this->positionX = value;
	this->status[1] = 1;
}

void ControlNode::setPositionY(float value)
{
	this->positionY = value;
	this->status[2] = 1;
}

int ControlNode::getNodeIdStatus()
{
	return this->status[0];
}
int ControlNode::getPositionXStatus()
{
	return this->status[1];
}
int ControlNode::getPositionYStatus()
{
	return this->status[2];
}
int ControlNode::getNumberOfFieldsStatus()
{
	return this->status[3];
}

void ControlNode::setFailStatus(int fieldNumber)
{
	this->status[fieldNumber-1] = 0;
}

void ControlNode::setSuccessStatus(int fieldNumber)
{
	this->status[fieldNumber-1] = 1;
}

void ControlNode::clear()
{
	this->nodeId.clear();
	this->positionX = 0;
	this->positionY = 0;
	for (int i = 0; i < NODE_STATUS_LEN; i++)
	{
		this->status[i] = 0;
	}
}

